package com.googlecode.servus.content;

import com.google.common.io.InputSupplier;
import com.googlecode.recycled.lang.assertions.Assert;

import java.io.IOException;

public class InputSuppliers {

    private InputSuppliers() {
    }

    public static <T> InputSupplier<T> asInputSupplier(final T inputStream) {
        Assert.notNull(inputStream);

        return new InputSupplier<T>() {
            public T getInput() throws IOException {
                return inputStream;
            }
        };
    }

}
